/**
 * @Filename: tester.h
 * @Description:
 * @Author: chengxiaojun
 * @Email: csforgood@gmail.com
 * @Time: 2011/11/11
 */
#ifndef __TESTER_H__
#define __TESTER_H__

#include "log.h"

#define EXPECT_TRUE(v) \
	if((v) == 0) { \
            ERROR_LOG("EXPECT_TRUE(%s) in %s:%d failed", #v,__FILE__,__LINE__); \
        } 

#define EXPECT_FALSE(v) \
	if((v) != 0) { \
            ERROR_LOG("EXPECT_FALSE(%s) in %s:%d failed", #v,__FILE__,__LINE__); \
        } 

#define EXPECT_EQ(v1,v2) \
	if(v1 != v2) {   \
            ERROR_LOG("EXPECT_EQ(%s = %d,%s = %d) in %s:%d failed", #v1,(v1),#v2,(v2),__FILE__,__LINE__); \
        }
#define EXPECT_STREQ(v1,v2) \
	if(strcmp((v1),(v2)) != 0) {   \
            ERROR_LOG("EXPECT_STREQ(%s = %s,%s = %s) in %s:%d failed", #v1,(v1),#v2,(v2),__FILE__,__LINE__); \
        }
#endif             
